package com.zhou.JavaAndroidFirm.constract;

import com.zhou.JavaAndroidFirm.base.BaseModel;
import com.zhou.JavaAndroidFirm.base.BasePresenter;
import com.zhou.JavaAndroidFirm.bean.CircleItem;
import com.zhou.JavaAndroidFirm.bean.CommentItem;
import com.zhou.JavaAndroidFirm.bean.CommonResponse;
import com.zhou.JavaAndroidFirm.bean.FavortItem;
import com.zhou.JavaAndroidFirm.bean.PageBean;

import java.util.List;

import rx.Observable;


/**
 * @author Administrator
 * @date 2018/7/20 0020
 * @des 朋友圈
 */
public interface CircleZoneContract {

    interface View extends BaseView {

        //获取未读总数
        void updateNotReadNewsCount(int count, String icon);

        void setListData(List<CircleItem> circleItems, PageBean pageBean);

        void setOnePublishData(CircleItem circleItem);

        void update2DeleteCircle(String circleId, int position);

        void update2AddFavorite(int circlePosition, FavortItem addItem);

        void update2DeleteFavort(int circlePosition, String UserId);

        void update2AddComment(int circlePosition, CommentItem addItem);

        void update2DeleteComment(int circlePosition, String commentId, int commentPosition);

        void updateEditTextBodyVisible(int visibility, CommentConfig commentConfig);

        void startProgressDialog();

        void stopProgressDialog();
    }

    interface Model extends BaseModel {
        //获取朋友圈未读消息数
        Observable<String> getZoneNotReadMsg();

        Observable<CommonResponse> getListDatas(String type, String uid, int page, int rows);

        Observable<CommonResponse> deleteCircle(String circleId, int position);

        Observable<CommonResponse> addFavort(String publishId, String publishUserId);

        Observable<CommonResponse> deleteFavort(String publishId, String publishUserId);

        Observable<CommonResponse> addComment(String publishUserId, CommentItem circleItem);

        Observable<CommonResponse> deleteComment(String commentId);

    }

    abstract class Presenter extends BasePresenter<View, Model> {
        //获取未读总数
        public abstract void getNotReadNewsCount();

        //获取数据
        public abstract void getListData(String type, String userId, int page, int rows);

        //删除
        public abstract void deleteCircle(final String circleId, int position);

        //点赞
        public abstract void addFavort(final String publishId, final String publishUserId, final int circlePosition, final android.view.View view);

        //取消点赞
        public abstract void deleteFavort(final String publishId, final String publishUserId, final int circlePosition);

        //增加评论
        public abstract void addComment(final String content, final CommentConfig config);

        //删除评论
        public abstract void deleteComment(final int circlePosition, final String commentId, int commentPosition);

        //显示评论输入框
        public abstract void showEditTextBody(CommentConfig commentConfig);
    }
}
